package source;

public abstract class TerrainFactory {

	/**
	 * @param args
	 */
	
	public static Terrain createTerrain(double randomNumber){
		if(randomNumber<.1)//10% chance
			return new Terrain(TerrainType.IMPASSABLE);
		else if(randomNumber>=.1 && randomNumber<.85)//75% chance
			return new Terrain(TerrainType.NORMAL);
		else if(randomNumber>=.85 && randomNumber<.9)//5% chance
			return new Terrain(TerrainType.SLOW);
		else//10% chance
			return new Planet();
	}
	
	public static Terrain createNormal(){
		return new Terrain(TerrainType.NORMAL);
	}
	
	public static Terrain createImpassable(){
		return new Terrain(TerrainType.IMPASSABLE);
	}
	
	public static Terrain createSlow(){
		return new Terrain(TerrainType.SLOW);
	}
	
	public static Planet createPlanet(){
		return new Planet();
	}
}
